package com.ofood.springcloud.controller;

import com.ofood.springcloud.domain.Result;
import com.ofood.springcloud.service.IFoodFeignService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class FoodFeignController {
    @Resource
    private IFoodFeignService foodFeignService;

    @GetMapping("/feign/consumer/food/get/{foodId}")
    public Result getFoodById(@PathVariable("foodId") long foodId){
        return foodFeignService.getFoodById(foodId);
    }

    @GetMapping("/feign/consumer/food/get/timeout")
    public String getFoodTimeout(){
        return foodFeignService.getFoodTimeout();
    }
}
